{template '_header'}
{php $this->followBar()}
<link rel="stylesheet" href="../addons/ewei_shopv2/plugin/groups/template/mobile/default/css/style.css" />
<div class='fui-page creditshop-index-page'>
	<div class="fui-header" style="z-index: 100;">
		<div class="fui-header-left">
			<a class="back"></a>
		</div>
		<div class="title">{$category_name['name']}</div>
		<div class="fui-header-right">
			{if !is_h5app()}
			<a href="javascript:void(0);" class="icon icon-menu category_menu"></a>
			{/if}
		</div>
		<div class="category_menu_list">
			<a href="{php echo mobileUrl('groups/category');}" class="external">全部活动</a>
			{loop $category $cate}
			<a href="{php echo mobileUrl('groups/category',array('category'=>$cate['id']));}" class="external">{$cate['name']}</a>
			{/loop}
		</div>
		<div class="lynn-mask fui-mask-m"></div>
	</div>
	<div class='fui-content navbar order-list' style="padding-bottom:0;">
		{if !is_mobile()}<div class="pcshop-index">{/if}
		<div class="fui-searchbar">
			<div class="searchbar">
				<a class="searchbar-cancel" id="search">搜索</a>
				<div class="search-input">
					<i class="icon icon-search"></i>
					<input type="search" id="keyword" placeholder="输入关键字..." value="{$keyword}">
				</div>
			</div>
		</div>
		<div class='fui-content-inner'style="padding:0;">
			<div class='content-loading'>
				<span class='fui-preloader'></span>
				<span class='text'>正在加载活动...</span>
			</div>
			<div class='content-empty'>
				<div class="fui-message fui-message-popup in">
					<div class="icon ">
						<i class="icon icon-information"></i>
					</div>
					<div class="content">未找到任何活动</div>
					<a class="btn btn-default btn-default block" href="{php echo mobileUrl('groups')}">去首页逛逛</a>
					<a class="btn btn-default btn-default block back">返回上一页</a>
				</div>
			</div>
			<ul class="lynn_index_list_ul row" id="container" style="background: none;"></ul>
		</div>
		{if !is_mobile()}</div>{/if}
	</div>
	<script id='tpl_list' type='text/html'>
		<%each list as item%>
		<li class="lynn_index_list_li fui-list goods-list">
			<a href="{php echo mobileUrl('groups/goods')}&id=<%item.id%>" class="lynn_index_list_a fui-list-media">
				<img src="<%item.thumb%>" alt="<%item.title%>" onerror="this.src='../addons/ewei_shopv2/static/images/nopic100.jpg'">
			</a>
			<div class="lynn_index_list_info fui-list-inner" onclick="window.location.href='{php echo mobileUrl('groups/goods')}&id=<%item.id%>';">
				<h3><%item.title%></h3>
				<p><%item.description%></p>
				<del>原价：¥<%item.price%></del>
				<div class="lynn_index_list_team">
						<span class="lynn_index_list_team_left">
							<strong><i class="icon icon-group"></i></strong>
							<%item.groupnum%>人团 ¥<em><%item.groupsprice%></em>/<%item.goodsnum%><%if item.units%><%item.units%><%else%>件<%/if%>
						</span>
					<a href="{php echo mobileUrl('groups/goods')}&id=<%item.id%>" class="lynn_index_list_team_a">去拼团 ></a>
				</div>
			</div>
		</li>
		<%/each%>
	</script>

	<script language="javascript">
		require(['../addons/ewei_shopv2/plugin/groups/static/js/category.js'],function(modal){
			modal.init({category: "{$_GPC['category']}", keyword: "{$_GPC['keyword']}"});
		});
	</script>
	<script language="javascript">
		$(function(){
			$(".category_menu_list").css("display","none")
			$(".category_menu").bind('click',function(){
				var $list = $("div.category_menu_list");
				if($list.css("display") == 'block'){
					$list.hide();
					$(".lynn-mask").hide();
				}else{
					$list.show();
					$(".lynn-mask").show();
				}
			})
			$(".lynn-mask").bind("click",function(){
				var $list = $("div.category_menu_list");
				if($list.css("display") == 'block'){
					$list.hide();
					$(".lynn-mask").hide();
				}else{
					$list.show();
					$(".lynn-mask").show();
				}
			})
			$("#search").click(function(){
				var kw = $.trim($("#keyword").val());
				location.href = "{php echo mobileUrl('groups/category')}&keyword="+kw+"&cate="+"{$category_name['id']}";
			});
		});
	</script>
</div>
{php $this->footerMenus()}
{template '_footer'}